Skip to content

Worker: a retried run restarts only its own unopened branch - #419

Merged
nambok merged 1 commit into
mainfrom
worker/retry-restarts-unopened-branch
Nov 3, 2026
Merged

nambok merged 1 commit into
mainfrom
worker/retry-restarts-unopened-branch

Conversation

@nambok

@nambok nambok commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

A retried run starts its branch from the base it computes now, which with stacking (#416) is the open pull request it builds on. A leftover branch from an earlier attempt that never opened a pull request is restarted there automatically, so nobody deletes a branch by hand. It only does that to CoderHelm's own branch.

Changes

  • clients/github.rs:
    • reset_decision and is_bot_commit.
    • In start_branch, a leftover branch with no open pull request is force-moved to the new base only when every commit it holds past that base was made by CoderHelm (a bot author, or a bot noreply email with no linked account).
    • A person's commits leave the branch untouched, as does a commit list GitHub may have cut short (250) or an unreadable comparison. The run then stops and says what to do: open a pull request from the branch, or rename or delete it.
    • An open pull request still keeps its head.
  • BranchStart::Reset note: "Restarted branch X from Y: an earlier attempt left it with no open pull request, so its commits were dropped and the work starts over there".
  • passes/mod.rs: when the base is the stacked pull request's branch, the note adds which pull request it builds on.

Verification

  • New test a_leftover_branch_restarts_only_when_it_is_coderhelms_and_has_no_pr covers: restart with only CoderHelm's commits (by login and by noreply email); an open pull request is kept; a person's commits are refused, with their names; a list that may be cut short is refused.
  • the_branch_note_says_what_happened is updated for the restart wording.
  • cargo fmt --check, cargo clippy -p worker --all-targets -D warnings, and cargo test -p worker: 1,160 passed, 0 failed.

… why

A retry starts its branch from the base it computes now (with stacking, the
open pull request it builds on). A leftover branch with no open pull request
is restarted there only when every commit it holds past that base is
CoderHelm's; a person's commits, or a list GitHub may have cut short, leave
it untouched and the run says what to do. An open pull request still keeps
its head. The progress note says it restarted, why, and names the stacked
pull request.
@nambok
nambok merged commit 8e31462 into main Nov 3, 2026
10 checks passed
@nambok
nambok deleted the worker/retry-restarts-unopened-branch branch November 3, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant